package com.zzyx.service.impl;

import java.util.Collection;
import java.util.List;
import java.util.Map;

import org.hibernate.criterion.DetachedCriteria;

import com.zzyx.bean.Hospital;
import com.zzyx.bean.Syscode;
import com.zzyx.dao.HospitalDAO;
import com.zzyx.service.HospitalService;

@SuppressWarnings("unchecked")
public class HospitalServiceImpl implements HospitalService
{
	private HospitalDAO hospitalDao;

	public HospitalDAO getHospitalDao()
	{
		return hospitalDao;
	}

	public void setHospitalDao(HospitalDAO hospitalDao)
	{
		this.hospitalDao = hospitalDao;
	}

	public void delete(Hospital e)
	{
		hospitalDao.delete(e);
	}

	public void deleteAll(Collection<Hospital> c)
	{
		hospitalDao.deleteAll(c);

	}

	public void deleteById(Class<Hospital> entityClass, Integer id)
	{
		hospitalDao.deleteById(entityClass, id);

	}

	public List<Hospital> findAll(Class<Hospital> entityClass)
	{

		return hospitalDao.findAll(entityClass);
	}

	public List<Hospital> findByAll(DetachedCriteria dc)
	{
		return hospitalDao.findByAll(dc);
	}

	public List<Hospital> findByCriteria(DetachedCriteria dc, int firstResult,
			int maxResult)
	{
		return hospitalDao.findByCriteria(dc, firstResult, maxResult);
	}

	public List<Hospital> findByCriteria(DetachedCriteria dc)
	{

		return hospitalDao.findByCriteria(dc);
	}

	public List<Hospital> findByHql(String hql, Map<String, Object> param,
			int firstResult, int maxResult)
	{
		return hospitalDao.findByHql(hql, param, firstResult, maxResult);
	}

	public Hospital findById(Class<Hospital> entityClass, Integer id)
	{
		return hospitalDao.findById(entityClass, id);
	}

	public List<Hospital> findByProperty(Class<Hospital> entityClass,
			String propertyName, Object value, int type)
	{
		return hospitalDao.findByProperty(entityClass, propertyName, value,
				type);
	}

	public Hospital findUniqueResult(String sql)
	{
		return hospitalDao.findUniqueResult(sql);
	}

	public void save(Hospital entity)
	{
		hospitalDao.save(entity);
	}

	public void saveOrUpdate(Hospital entity)
	{
		hospitalDao.saveOrUpdate(entity);

	}

	public void update(Collection<Hospital> c)
	{
		hospitalDao.update(c);

	}

	public List<Hospital> findAll()
	{
		return hospitalDao.findAll(Hospital.class);
	}

	public void delete(String delHospitals)
	{
		
		hospitalDao.delete(delHospitals);
		
	}

	
	public void save(String syscode, Hospital hospital) {
		hospitalDao.save(syscode,hospital);
	}

	
	public void update(String name, Hospital hospital) {
		hospitalDao.update(name,hospital);
		
	}

	
	public List<Hospital> findAllByorder() {
		
		return hospitalDao.findAllByorder();
	}

	
	public List<Hospital> findByHql(String hql) {
		// TODO Auto-generated method stub
		return hospitalDao.findByHql(hql);
	}

	
	public List<Hospital> findByHql(String hql, int start, int max) {
		// TODO Auto-generated method stub
		return hospitalDao.findByHql(hql, start, max);
	}

}
